package com.todo.event.activity.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;
import java.util.Map;
import java.util.stream.Collectors;

/**
 * @author azhebuxing
 * @date 2025/1/8 08:31
 * @description
 */
@Getter
@AllArgsConstructor
public enum EventActivityDynamicWordEnum {

    USER_NIKE_NAME("userNickName", "用户昵称"),
    SURNAME("surname", "用户姓氏 X先生/女生"),
    CURRENT_CITY("currentCity", "当前位置 市级别"),
    ;

    private static Map<String, EventActivityDynamicWordEnum> typeMap = Arrays
            .stream(EventActivityDynamicWordEnum.values())
            .collect(Collectors.toMap(EventActivityDynamicWordEnum::getCode, item -> item, (v1, v2) -> v2));

    private String code;
    private String name;


    public static EventActivityDynamicWordEnum getByType(String code) {
        return typeMap.get(code);
    }
}
